<!-- HTML header for doxygen 1.8.20-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
	<meta http-equiv="X-UA-Compatible" content="IE=9"/>
	<meta name="generator" content="Doxygen 1.9.4"/>
	<meta name="viewport" content="width=device-width, initial-scale=1"/>
	<title>Raspberry Pi Pico SDK: hardware_pll</title>
	<!-- <link href="tabs.css" rel="stylesheet" type="text/css"/> -->
	<script type="text/javascript" src="jquery.js"></script>
	<script type="text/javascript" src="dynsections.js"></script>
	<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
	<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
    <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet">
	<link href="doxygen.css" rel="stylesheet" type="text/css" />
	<link href="normalise.css" rel="stylesheet" type="text/css"/>
<link href="main.css" rel="stylesheet" type="text/css"/>
<link href="styles.css" rel="stylesheet" type="text/css"/>
</head>
<body>
	<div class="navigation-mobile">
		<div class="logo--mobile">
			<a href="/"><img src="logo-mobile.svg" alt="Raspberry Pi"></a>
		</div>
		<div class="navigation-toggle">
			<span class="line-1"></span>
			<span class="line-2">
				<p>Menu Toggle</p>
			</span>
			<span class="line-3"></span>
		</div>
	</div>
	<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
		<div class="logo">
			<a href="index.html"> <img src="logo.svg" alt="Raspberry Pi"></a>
			<span style="display: inline-block; margin-top: 10px;">
				v2.0.0
			</span>
		</div>
		<div class="navigation-footer">
			<img src="logo-mobile.svg" alt="Raspberry Pi">
			<a href="https://www.raspberrypi.com/" target="_blank">By Raspberry Pi Ltd</a>
		</div>
<!-- 		<div class="search">
			<form>
				<input type="search" name="search" id="search" placeholder="Search">
				<input type="submit" value="Search">
			</form>
		</div> -->
<!-- Generated by Doxygen 1.9.4 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('group__hardware__pll.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle"><div class="title">hardware_pll<div class="ingroups"><a class="el" href="group__hardware.html">Hardware APIs</a></div></div></div>
</div><!--header-->
<div class="contents">

<p>Phase Locked Loop control APIs.  
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:gab0c11a480c3c39d63505a8f0d9f5f1ee"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__pll.html#gab0c11a480c3c39d63505a8f0d9f5f1ee">PLL_RESET_NUM</a>(pll)</td></tr>
<tr class="memdesc:gab0c11a480c3c39d63505a8f0d9f5f1ee"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the <a class="el" href="group__hardware__resets.html#ga53804b75cce5eb3090d482b0af2a7ce0">reset_num_t</a> used to reset a given PLL instance.  <a href="group__hardware__pll.html#gab0c11a480c3c39d63505a8f0d9f5f1ee">More...</a><br /></td></tr>
<tr class="separator:gab0c11a480c3c39d63505a8f0d9f5f1ee"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga67cfd74241b25d891f761af9b40d1ac8"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__pll.html#ga67cfd74241b25d891f761af9b40d1ac8">pll_init</a> (<a class="el" href="structpll__hw__t.html">PLL</a> pll, uint ref_div, uint vco_freq, uint post_div1, uint post_div2)</td></tr>
<tr class="memdesc:ga67cfd74241b25d891f761af9b40d1ac8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialise specified PLL.  <a href="group__hardware__pll.html#ga67cfd74241b25d891f761af9b40d1ac8">More...</a><br /></td></tr>
<tr class="separator:ga67cfd74241b25d891f761af9b40d1ac8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4529ac07cbd8575938245850d20aba29"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__pll.html#ga4529ac07cbd8575938245850d20aba29">pll_deinit</a> (<a class="el" href="structpll__hw__t.html">PLL</a> pll)</td></tr>
<tr class="memdesc:ga4529ac07cbd8575938245850d20aba29"><td class="mdescLeft">&#160;</td><td class="mdescRight">Release/uninitialise specified PLL.  <a href="group__hardware__pll.html#ga4529ac07cbd8575938245850d20aba29">More...</a><br /></td></tr>
<tr class="separator:ga4529ac07cbd8575938245850d20aba29"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p >Phase Locked Loop control APIs. </p>
<p >There are two PLLs in RP2040. They are:</p><ul>
<li>pll_sys - Used to generate up to a 133MHz system clock</li>
<li>pll_usb - Used to generate a 48MHz USB reference clock</li>
</ul>
<p >For details on how the PLLs are calculated, please refer to the RP2040 datasheet. </p>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a id="gab0c11a480c3c39d63505a8f0d9f5f1ee" name="gab0c11a480c3c39d63505a8f0d9f5f1ee"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab0c11a480c3c39d63505a8f0d9f5f1ee">&#9670;&nbsp;</a></span>PLL_RESET_NUM</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define PLL_RESET_NUM</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">pll</td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns the <a class="el" href="group__hardware__resets.html#ga53804b75cce5eb3090d482b0af2a7ce0">reset_num_t</a> used to reset a given PLL instance. </p>
<p >Note this macro is intended to resolve at compile time, and does no parameter checking </p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga4529ac07cbd8575938245850d20aba29" name="ga4529ac07cbd8575938245850d20aba29"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga4529ac07cbd8575938245850d20aba29">&#9670;&nbsp;</a></span>pll_deinit()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void pll_deinit </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structpll__hw__t.html">PLL</a>&#160;</td>
          <td class="paramname"><em>pll</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Release/uninitialise specified PLL. </p>
<p >This will turn off the power to the specified PLL. Note this function does not currently check if the PLL is in use before powering it off so should be used with care.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pll</td><td>pll_sys or pll_usb </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga67cfd74241b25d891f761af9b40d1ac8" name="ga67cfd74241b25d891f761af9b40d1ac8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga67cfd74241b25d891f761af9b40d1ac8">&#9670;&nbsp;</a></span>pll_init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void pll_init </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structpll__hw__t.html">PLL</a>&#160;</td>
          <td class="paramname"><em>pll</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint&#160;</td>
          <td class="paramname"><em>ref_div</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint&#160;</td>
          <td class="paramname"><em>vco_freq</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint&#160;</td>
          <td class="paramname"><em>post_div1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint&#160;</td>
          <td class="paramname"><em>post_div2</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialise specified PLL. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pll</td><td>pll_sys or pll_usb </td></tr>
    <tr><td class="paramname">ref_div</td><td>Input clock divider. </td></tr>
    <tr><td class="paramname">vco_freq</td><td>Requested output from the VCO (voltage controlled oscillator) </td></tr>
    <tr><td class="paramname">post_div1</td><td>Post Divider 1 - range 1-7. Must be &gt;= post_div2 </td></tr>
    <tr><td class="paramname">post_div2</td><td>Post Divider 2 - range 1-7 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->

	<script src="main.js"></script>
</body>
</html>